/** JSONSerializable */
package json;
import org.json.JSONObject;

/**
 * Specifies methods to be included in any class that can be serialized
 * into or populated from valid JSON.
 * @author Reid Harrison
 * @version 1.0
 */
public interface JSONSerializable {
	
	/**
	 * Returns the object's data in the form of a valid JSON String.
	 * @return String
	 */
	String toString();
	
	/**
	 * Returns the object's data in a JSONObject.
	 * @return JSONObject
	 */
	JSONObject getJSON();
	
	/**
	 * Populates the object's data with the given JSONObject.
	 * @param json
	 */
	void populateFromJSON(JSONObject json);
}
